


JOIN(1L)          MISC. REFERENCE MANUAL PAGES           JOIN(1L)



NAME
     join - join lines of two files on a common field

SYNOPSIS
     join [-a 1|2] [-v 1|2] [-e empty-string] [-o  field-list...]
     [-t char] [-j[1|2] field] [-1 field] [-2 field] file1 file2

DESCRIPTION
     This manual page documents the GNU version  of  join.   join
     prints  to the standard output a line for each pair of input
     lines, one each from _f_i_l_e_1 and _f_i_l_e_2,  that  have  identical
     join  fields.   Either  filename  (but not both) can be `-',
     meaning the standard  input.   _f_i_l_e_1  and  _f_i_l_e_2  should  be
     already  sorted in increasing order (not numerically) on the
     join fields; unless the -_t option is given, they  should  be
     sorted  ignoring  blanks  at  the start of the line, as sort
     does when given the -_b option.

     The defaults are: the join field is the first field in  each
     line;  fields  in  the  input  are  separated by one or more
     blanks, with leading blanks on the line ignored;  fields  in
     the  output  are separated by a space; each output line con-
     sists of the join field, the remaining  fields  from  _f_i_l_e_1,
     then the remaining fields from _f_i_l_e_2.

  OPTIONS
     -_a _f_i_l_e-_n_u_m_b_e_r
          Print a line for each unpairable  line  in  file  _f_i_l_e-
          _n_u_m_b_e_r  (either 1 or 2), in addition to the normal out-
          put.

     -_e _s_t_r_i_n_g
          Replace empty output fields (those that are missing  in
          the input) with _s_t_r_i_n_g.

     -_1, -_j_1 _f_i_e_l_d
          Join on field _f_i_e_l_d (a positive integer) of file 1.

     -_2, -_j_2 _f_i_e_l_d
          Join on field _f_i_e_l_d (a positive integer) of file 2.

     -_j _f_i_e_l_d
          Equivalent to -_1 _f_i_e_l_d -_2 _f_i_e_l_d.

     -_o _f_i_e_l_d-_l_i_s_t...
          Construct each output line according to the  format  in
          _f_i_e_l_d-_l_i_s_t.   Each  element in _f_i_e_l_d-_l_i_s_t consists of a
          file number (either 1 or 2),  a  period,  and  a  field
          number  (a positive integer).  The elements in the list
          are separated by commas or blanks.  Multiple _f_i_e_l_d-_l_i_s_t
          arguments  can  be  given after a single -_o option; the
          values of all lists  given  with  -_o  are  concatenated



Sun Release 4.1           Last change:                          1






JOIN(1L)          MISC. REFERENCE MANUAL PAGES           JOIN(1L)



          together.

     -_t _c_h_a_r
          Use character  _c_h_a_r  as  the  input  and  output  field
          separator.

     -_v _f_i_l_e-_n_u_m_b_e_r
          Print a line for each unpairable  line  in  file  _f_i_l_e-
          _n_u_m_b_e_r (either 1 or 2), instead of the normal output.

     The long-named options can be introduced with `+' as well as
     `--',  for compatibility with previous releases.  Eventually
     support for `+' will be removed, because it is  incompatible
     with the POSIX.2 standard.









































Sun Release 4.1           Last change:                          2



